from flask_restful import Api

# 系统的这个json不能满足我们的需求,所以不用
# from flask_restful.representations import json
from .output import output_json


class BaseApi(Api):

    def __init__(self, app=None, prefix='',
                 default_mediatype='application/json', decorators=None,
                 catch_all_404s=False, serve_challenge_on_401=False,
                 url_part_order='bae', errors=None):

        # 父类做什么,还需要继承他让他去做
        super().__init__(app=app,prefix=prefix,
                       default_mediatype=default_mediatype,
                       decorators=decorators,catch_all_404s=catch_all_404s,
                       url_part_order=url_part_order,errors=errors)

        # 此处就是我们需要重写的内容
        self.representations = {"application/json":output_json}

